<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>重复渐变</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        body {
            background-color: #ccc;
        }

        div {
            margin: 60px auto;
        }

        .basic {
            width: 300px;
            height: 300px;
            /* 这样做可以实现效果，但是麻烦 */
            background: radial-gradient(#fff 0%, #fff 10%, #000 10%, #000 20%,
                #fff 20%, #fff 30%, #000 30%, #000 40%, #fff 40%, #fff 50%, 
                #000 50%, #000 60%, #fff 60%, #fff 70%, #000 70%, #000 80%,
                #fff 80%, #fff 90%, #000 90%, #000 100%);
        }

        .repeat-gradient {
            width: 300px;
            height: 300px;
            /* 设置重复径向渐变 */
            background: repeating-radial-gradient(circle at center center, #fff 0%, #fff 10%, #000 10%, #000 20%);
        }

        div:last-of-type {
            width: 300px;
            height: 800px;
            /* 设置重复线性渐变 */
            /* background: repeating-linear-gradient(to bottom, #fff 0%, #fff 10%, #000 10%, #000 20%) */
            background: repeating-linear-gradient(45deg, #fff 0%, #fff 10%, #000 10%, #000 20%)
        }
    </style>
</head>
<body>
    <div class="basic"></div>
    <div class="repeat-gradient"></div>
    <div></div>
</body>
</html>